<template>
<div>
  <h1>电影展示</h1>
  <table>
    <tr>
      <td>电影</td>
      <td>上映时间</td>
      <td>展示</td>
    </tr>
    <tr v-for="i in list">
      <td>
        <router-link :to="{path:'/dy_xq',query:{id:i.id}}">{{i.name}}</router-link>
      </td>
      <td>{{i.tiam}}</td>
      <td>
        <img :src="'http://127.0.0.1:8000'+i.pic" alt="" width="200px">
      </td>
    </tr>
  </table>
  <button v-for="i in num" @click="show_dy(i)">{{i}}</button>

</div>
</template>

<script>
export default {
  name: "diany",
  data(){
    return{
      list:[],
      num : ""
    }
  },
  methods:{
    show_dy(i){
      this.$axios.get('users/Diany_API/?cpage='+i)
      .then(i=>{
        this.list = i.data.list
        this.num = i.data.num
      })
    }
  },
  mounted() {
    this.show_dy(1)
  }

}
</script>

<style scoped>

</style>
